<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

if (!function_exists('get_numero10000')) {
    function get_numero10000($row = null) {
        return '<input value="'.($row['valor'] == '' ? 0 : $row['valor']).'" maxlength="4" 
                class="class_input_spin10000 spin_input sizew70" type="input" name="field_'.$row['id'].'" 
                id="field_'.$row['id'].'" style="margin-right: 0px; padding-right: 0px;"/>';
    }
}

if (!function_exists('get_numero1000')) {
    function get_numero1000($row = null) {
        return '<input value="'.($row['valor'] == '' ? 0 : $row['valor']).'" maxlength="4" 
                class="class_input_spin1000 spin_input sizew50" type="input" name="field_'.$row['id'].'" 
                id="field_'.$row['id'].'" style="margin-right: 0px; padding-right: 0px;"/>';
    }
}

if (!function_exists('get_numero')) {
    function get_numero($row = null) {
        return '<input value="'.($row['valor'] == '' ? 0 : $row['valor']).'" maxlength="2" 
                class="class_input_spin spin_input sizew30" type="input" name="field_'.$row['id'].'" 
                id="field_'.$row['id'].'" style="margin-right: 0px; padding-right: 0px;"/>';
    }
}

if (!function_exists('get_radio')) {
    function get_radio($row = null) {
        return '<ul class="formee-list">
                    <li>
                        <input value="1" type="radio" '.($row['valor'] == '' || $row['valor'] == 0 ? '' : 'checked="checked"').' name="field_'.$row['id'].'">
                        <label>Si</label>
                    </li>
                    <li>
                        <input value="0" type="radio" '.($row['valor'] == '' || $row['valor'] == 0 ? 'checked="checked"' : '').' name="field_'.$row['id'].'">
                        <label>No</label>
                    </li>
                </ul>';
    }
}

if (!function_exists('gestion_campos')) {
    function gestion_campos($tipo_campo = null, $row = null){
        switch ($tipo_campo) {
            case 1:
                return "";
                break;
            case 2:
                return "";
                break;
            case 3:
                return get_radio($row);
                break;
            case 4:
                return "";
                break;
            case 5:
                return get_numero($row);
                break;
            case 6:
                return "";
                break;
            case 7:
                return get_numero1000($row);
                break;
            case 8:
                return get_numero10000($row);
                break;
        }
    }
}